/*
 * MainMenu.java
 *
 * Created on __DATE__, __TIME__
 */

package serverPresentation;

import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class MainMenu extends javax.swing.JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** Creates new form MainMenu 
	 * @throws UnsupportedLookAndFeelException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException */
	public MainMenu() {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
		
		initComponents();
		
		Image im = Toolkit.getDefaultToolkit().getImage("images/security-icon.gif");
		this.setIconImage(im);
	}

	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		addUserPassword = new javax.swing.JButton();
		addUserCc = new javax.swing.JButton();
		addUserCompetence = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);

		addUserPassword.setText("Adicionar Utilizador com Palavra-Passe");
		addUserPassword.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
				addUserPasswordMouseClicked(evt);
			}
		});

		addUserCc.setText("Adicionar Utilizador com Cart\u00e3o Cidad\u00e3o");
		addUserCc.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
				addUserCcMouseClicked(evt);
			}
		});

		addUserCompetence.setText("Adicionar Compet\u00eancia a Utilizador");
		addUserCompetence.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
				addUserCompetenceMouseClicked(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(85, 85, 85)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(addUserCompetence)
												.addComponent(addUserCc)
												.addComponent(
														addUserPassword,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														258,
														javax.swing.GroupLayout.PREFERRED_SIZE))
								.addContainerGap(83, Short.MAX_VALUE)));

		layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
				new java.awt.Component[] { addUserCc, addUserCompetence,
						addUserPassword });

		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(addUserPassword,
								javax.swing.GroupLayout.PREFERRED_SIZE, 47,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(17, 17, 17)
						.addComponent(addUserCc,
								javax.swing.GroupLayout.PREFERRED_SIZE, 25,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(18, 18, 18)
						.addComponent(addUserCompetence)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));

		layout.linkSize(javax.swing.SwingConstants.VERTICAL,
				new java.awt.Component[] { addUserCc, addUserCompetence,
						addUserPassword });

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void addUserCompetenceMouseClicked(java.awt.event.MouseEvent evt) {
		this.setVisible(false);
		passwordValidationDialog validationDialog = new passwordValidationDialog("AddUserCompetenceMenu");
		validationDialog.setVisible(true);
	}

	private void addUserCcMouseClicked(java.awt.event.MouseEvent evt) {
		this.setVisible(false);
		passwordValidationDialog validationDialog = new passwordValidationDialog("AddUserWithCcMenu");
		validationDialog.setVisible(true);
	}

	private void addUserPasswordMouseClicked(java.awt.event.MouseEvent evt) {
		this.setVisible(false);
		passwordValidationDialog validationDialog = new passwordValidationDialog("AddUserWithPasswordMenu");
		validationDialog.setVisible(true);
	}

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new MainMenu().setVisible(true);
			}
		});
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton addUserCc;
	private javax.swing.JButton addUserCompetence;
	private javax.swing.JButton addUserPassword;
	// End of variables declaration//GEN-END:variables

}